package inter;

import symbols.Type;
import lexer.Token;

public class Relacao extends Logical {
	public Relacao(Token tok, Expr x1, Expr x2) {
		super(tok, x1, x2);
	}
	
	public Type check(Type p1, Type p2) {
		//if(p1 instanceof Arrays || p2 instanceof Arrays){
//			return null;
//		}else if(p1 == p2){
		if(p1 == p2){
			return Type.BOOL;
		}else{
			return null;
		}
	}
	
	public void juming(int t, int f){
		Expr a = expr1.reduce();
		Expr b = expr2.reduce();
		
		String test = a.toString() + " " + op.toString() + " " + b.toString();
		
		emitJumps(test, t, f);
	}
}
